import instance from '@/utils/request'
// 获取角色列表
export const getEmployeeList = (params) => instance.get('/sys/user', { params })
// 导出excel表格
export const exportExcel = () => instance.get('/sys/user/export', {
  responseType: 'blob' // 指定响应的数据类型 - 二进制流
})
// 导入员工模板
export const getExportTemplate = () => instance.get('/sys/user/import/template', {
  responseType: 'blob'
})
// 批量导入员工
export const uploadExcel = (data) => instance.post('/sys/user/import', data)
// 删除员工
export const delEmployee = (id) => instance.delete(`/sys/user/${id}`)
// 新增员工
export const addEmployee = (data) => instance.post('/sys/user', data)
// 获取员工详情
export const getEmployeeDetail = (id) => instance.get(`/sys/user/${id}`)
// 修改员工详情
export const changeEmployeeDetail = (data) => instance.put(`/sys/user/${data.id}`, data)
// 分配角色权限
export const assignRoles = (data) => instance.put('/sys/user/assignRoles', data)
